package com.lcxw.hxzbapi.service;

import com.lcxw.hxzbapi.entity.response.Response;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;
import com.lcxw.hxzbapi.dao.mapper.GiftSendMapper;
import com.lcxw.hxzbapi.entity.pojo.GiftSend;

@Component
public class GiftSendService {

    @Resource
    GiftSendMapper giftSendMapper;

    public int insertGiftEarn(GiftSend giftearn) throws Exception {
        return giftSendMapper.insertGiftEarn(giftearn);
    }

    public List<GiftSend> selectByFromUserId(long fromUserId) throws Exception {
        return giftSendMapper.selectByFromUserId(fromUserId);
    }

    public List<GiftSend> selectByFromUserIdWithPage(long fromUserId, int pageNum, int pageSize) {
        return giftSendMapper.selectByFromUserIdWithPage(fromUserId, pageNum, pageSize);
    }



    public int selectCountByfromUserId(long fromUserId) {
        return giftSendMapper.selectCountByfromUserId(fromUserId);
    }

    public List<GiftSend> selectByUserId(long userId) {
        return giftSendMapper.selectByUserId(userId);
    }

    public List<GiftSend> selectByUserIdWithPage(long userId, int pageNum, int pageSize) {
        return giftSendMapper.selectByUserIdWithPage(userId, pageNum, pageSize);
    }

    public int selectCountByUserId(long userId) {
        return giftSendMapper.selectCountByUserId(userId);
    }

    public List<GiftSend> selectByUserIdAndFromUserId(long userId, long fromUserId)
        throws Exception {
        return giftSendMapper.selectByUserIdIdAndFromUserId(userId, fromUserId);
    }

    public List<GiftSend> selectByRoomId(long roomId) {
        return giftSendMapper.selectByRoomId(roomId);
    }

    public List<GiftSend> selectCurrentDayByRoomId(long roomId, String addTime) {
        return giftSendMapper.selectCurrentDayByRoomId(roomId, addTime);
    }

    public int updateByRoomId(GiftSend gift) throws Exception {
        return giftSendMapper.updateByRoomId(gift);
    }

    public List<GiftSend> selectAll() throws Exception {
        return giftSendMapper.selectAll();
    }

    public List<GiftSend> selectAfterTime(String time) throws Exception {
        return giftSendMapper.selectAfterTime(time);
    }

}